<?php
/**
 * Created by PhpStorm.
 * @author: 汤文辉
 * @since: 2017/6/20 11:25
 *图书分类显示，获得各类图书的数目
 */
include("config/mysqlconfig.php");
include("class/Book.php");

if (is_array($_GET)&&count($_GET)>0) {
	$kindid = $_GET['kind'];
	switch ($kindid) {
		case '001':
			$kind = "文学";
			break;
		case '002':
			$kind = "历史";
			break;
		case '003':
			$kind = "社会";
			break;
		case '004':
			$kind = "教育";
			break;
		case '005':
			$kind = "其他";
			break;
	}
}else{
	$kindid = 001;
	$kind = "文学";
}
$book = new Book($con);
if(!empty($kind)){
    $book_info = $book->getBookByKind($kind);
    $k=array("文学","历史", "社会","教育","其他");
    $count = $book->getKindNum($k);
 }